#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include<unistd.h>
int main(){

    int fd=open("./bite.txt",O_RDWR |O_CREAT,0664 );
    if(fd<0){
        perror("open");
        return 0;
    }
    const char* str= "I like linux";
    size_t w_size= write(fd,str,strlen(str));
    printf("w_size:%d\n",w_size);

    lseek(fd,0,SEEK_SET);
    char buf[1024]={0};
    size_t  r_size = read(fd,buf,sizeof(buf)-1);
    printf("r_size:%d,buf:%s\n",r_size,buf);

    close(fd);
    return 0;
}
